<?php

defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view' );

class ApkipasViewTags extends JView{
	
	protected $items;
	protected $pagination;
	protected $state;
	
	function display($tpl = null) {
		
		$this->setModel($this->getModel(), true);
		$fnc = 'display'.ucfirst($this->getLayout());
		if (is_callable(array(&$this, $fnc)))
			$this->$fnc($tpl);
		else
			parent::display($tpl);
	}

	function displayDefault($tpl = null){

		$mainframe = &JFactory::getApplication();
		$context = JRequest::getCmd('option');
		$view = JRequest::getCmd('view');
		
		ApkipasHelper::subMenu();
		$this->addDefaultToolbar();
		
		$this->items		= $this->get('Items');
		$this->pagination	= $this->get('Pagination');
		$this->state		= $this->get('State');
		
	    parent::display($tpl);
  	}
  
  	function displayForm($tpl = null){
		parent::display($tpl);
	}
	
	protected function addDefaultToolbar()
	{
		JToolBarHelper::title('Tags', 'contact.png');
		JToolBarHelper::addNew('tags.add');
		JToolBarHelper::editList('tags.edit');
		JToolBarHelper::divider();
		JToolBarHelper::publish('tags.publish', 'JTOOLBAR_PUBLISH', true);
		JToolBarHelper::unpublish('tags.unpublish', 'JTOOLBAR_UNPUBLISH', true);
		JToolBarHelper::divider();
		JToolBarHelper::deleteList('', 'tags.delete', 'JTOOLBAR_EMPTY_TRASH');
		JToolBarHelper::divider();
		JToolBarHelper::preferences('com_apkipas');
	}
	
	protected function addFormToolbar()
	{
		JToolBarHelper::title('Tag', 'contact.png');
		JToolBarHelper::save('tags.save');
		JToolBarHelper::cancel();
	}
}
?>